home *** CD-ROM | disk | FTP | other *** search
/ Openstep 4.2 (Developer) / Openstep Developer 4.2.iso / NextDeveloper / OpenStepConversion / IntermediateFrameworks5 / AppKit.framework / Headers / chunk.h < prev    next >
Encoding:
C/C++ Source or Header  |  1994-11-15  |  1.2 KB  |  32 lines

  1. /*
  2.     chunk.h
  3.     Application Kit, Release 2.0
  4.     Copyright (c) 1988, 1989, 1990, NeXT, Inc.  All rights reserved. 
  5. */
  6.  
  7. #import <Foundation/NSZone.h>
  8.  
  9. /*
  10.  *  NXChunks implement variable sized arrays of records.  Allocation is by
  11.  *  the given size (in bytes) --- typically a multiple number of records, say 10.
  12.  *  The block of memory never shrinks, and the chunk records the current number
  13.  *  of elements.  To use the NXChunks, you declare a struct w/ NXChunk as its
  14.  *  first field.
  15.  */
  16.  
  17. typedef struct _NXChunk {
  18.     short           growby;    /* increment to grow by */
  19.     int             allocated;    /* how much is allocated */
  20.     int             used;    /* how much is used */
  21. } NSTextChunk;
  22.  
  23. extern NSTextChunk *NSChunkMalloc(int growBy, int initUsed);
  24. extern NSTextChunk *NSChunkRealloc(NSTextChunk *pc);
  25. extern NSTextChunk *NSChunkGrow(NSTextChunk *pc, int newUsed);
  26. extern NSTextChunk *NSChunkCopy(NSTextChunk *pc, NSTextChunk *dpc);
  27.  
  28. extern NSTextChunk *NSChunkZoneMalloc(int growBy, int initUsed, NSZone *zone);
  29. extern NSTextChunk *NSChunkZoneRealloc(NSTextChunk *pc, NSZone *zone);
  30. extern NSTextChunk *NSChunkZoneGrow(NSTextChunk *pc, int newUsed, NSZone *zone);
  31. extern NSTextChunk *NSChunkZoneCopy(NSTextChunk *pc, NSTextChunk *dpc, NSZone *zone);
  32.